/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */


bool isSameTree(struct TreeNode* p, struct TreeNode* q){
   if(!q ^ !p)
        return false;
    if(!p && !q)
        return true;
   return  p->val == q->val && isSameTree(q->left, p->left) && isSameTree(q->right, p->right);
}